package com.lcm.springcloud.model.converter;

import com.lcm.springcloud.model.entity.Payment;
import com.lcm.springcloud.param.PaymentParam;
import com.lcm.springcloud.vo.PaymentVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author: Coder-Lcm
 * @date: 2020/10/27 13:17
 */
@Mapper
public interface PaymentConverter {
    PaymentConverter INSTANCE = Mappers.getMapper(PaymentConverter.class);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "serial", target = "serial")
    })
    Payment toPayment(PaymentParam param);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "serial", target = "serial")
    })
    PaymentVO toPaymentVO(Payment payment);
}

